package com.ling.sbbyyds.mapper.video;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ling.sbbyyds.entity.video.VideoComment;
import com.ling.sbbyyds.interaction.dto.video.CommentDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 视频评论表表数据库访问层
 *
 * @author ling
 * @since 2022-07-23 17:48:18
 */
@Repository
public interface SbbVideoCommentMapper extends BaseMapper<VideoComment> {

    /**
     * 获取视频的评论列表
     *
     * @param videoId
     * @return
     */
    List<CommentDto> queryCommentsByVideoId(@Param("videoId") Long videoId);


    Integer queryCommentsByVideoIdCount(@Param("videoId") Long videoId);


    /**
     * 获取去视频的评论
     *
     * @param videoId  视频id
     * @param level    等级 > 0 查二级及以上的
     * @param parentId 父评论id
     * @return
     */
    List<CommentDto> queryReplyByVideoId(Long videoId, Integer level, Long parentId);


}

